import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "about_orm.settings")

import django

django.setup()
from app01 import models

from django.db import transaction
from django.db.models import F

with transaction.atomic():
    models.Book.objects.all().update(kucun=F('kucun') - 10)
    models.Book.objects.all().update(sale=F('sale') + 10)
